package com.example.myapplication;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager2.adapter.FragmentStateAdapter;

public class Mypageadapter extends FragmentStateAdapter {

    public Mypageadapter(FragmentActivity fm) {
        super(fm);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if(position==0){
            return new firstfragment();
        } else if (position==1) {
            return new secondfragment();
        }else{
            return new thirdfragment();
        }
    }

    @Override
    public int getItemCount() {
        return 3;
    }
}